import { createApp } from 'vue';
// global css
import 'virtual:uno.css';
import '@/assets/styles/index.scss';
import 'element-plus/theme-chalk/dark/css-vars.css';

// App、router、store
import App from './App.vue';
import store from './store';
import router from './router';

// 自定义指令
import directive from './directive';

// 注册插件
import plugins from './plugins/index'; // plugins

import "sv-print/dist/style.css"; // 打印插件
// 高亮组件
// import 'highlight.js/styles/a11y-light.css';
import 'highlight.js/styles/atom-one-dark.css';
import 'highlight.js/lib/common';
import HighLight from '@highlightjs/vue-plugin';
// hiprint
// import { hiPrintPlugin } from '@/utils/hiprint'
import { hiPrintPlugin } from 'vue-plugin-hiprint'
// svg图标
import 'virtual:svg-icons-register';
import ElementIcons from '@/plugins/svgicon';
// permission control
import './permission';
// ppt
import '@icon-park/vue-next/styles/index.css'
import 'prosemirror-view/style/prosemirror.css'
import 'animate.css'
import '@/components/PPTist/assets/styles/prosemirror.scss'
import '@/components/PPTist/assets/styles/font.scss'
import intro from 'intro.js';
import 'intro.js/introjs.css';
import 'intro.js/themes/introjs-modern.css';
// 国际化
import i18n from '@/lang/index';

// vxeTable
import VXETable from 'vxe-table';
import 'vxe-table/lib/style.css';
VXETable.config({
  zIndex: 999999
});

import Icon from '@/components/PPTist/plugins/icon'
import Directive from '@/components/PPTist/plugins/directive'


import {toDecimal} from '@/utils/calculate';

/**  ppt结束 */
// 修改 el-dialog 默认点击遮照为不关闭
import { ElDialog, ElMessage } from 'element-plus';

ElDialog.props.closeOnClickModal.default = false;
// 修改 el-table 默认显示滚动条
import { ElTable } from 'element-plus';
ElTable.props.scrollbarAlwaysOn.default = true;
const app = createApp(App);

app.use(hiPrintPlugin, '$pluginName')
hiPrintPlugin.disAutoConnect();
app.use(HighLight);
app.use(ElementIcons);
app.use(router);
app.use(store);
app.use(i18n);
app.use(VXETable);
app.use(Icon)
app.use(Directive)
// app.use(PPTDesigner);
app.use(plugins);
// 自定义指令
directive(app);

// import ElementUI from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';
import 'element-plus/dist/index.css';
import '@/IM/assets/iconfont/iconfont.css';
// import httpRequest from '@/IM/api/httpRequest';
import * as socketApi from '@/IM/api/wssocket';
import * as messageType from '@/IM/api/messageType';
import emotion from '@/IM/api/emotion.js';
import element from '@/IM/api/element.js';
import * as  enums from '@/IM/api/enums.js';
import * as  date from '@/IM/api/date.js';
import '@/IM/utils/directive/dialogDrag';
import { createPinia, PiniaVuePlugin } from 'pinia'
app.use(PiniaVuePlugin)
const pinia = createPinia()
app.use(pinia);
// IM方法
// app.use(ElementUI);
// 挂载全局
app.config.globalProperties.$wsApi = socketApi;
app.config.globalProperties.$msgType = messageType
app.config.globalProperties.$date = date;
// app.config.globalProperties.$http = httpRequest // http请求方法
app.config.globalProperties.$emo = emotion; // emo表情
app.config.globalProperties.$elm = element; // 元素操作
app.config.globalProperties.$enums = enums; // 枚举
app.config.globalProperties.$message = ElMessage; // message
app.config.globalProperties.$toDecimal = toDecimal; // message

app.mount('#app');
